const app = getApp()
import { orderSummaryList } from '../../../../../../api/order'
Component({
    attached: function () {
        // this.getCardList()
    },
    properties: {
        memberId: {
            type: String,
            value: "",
          },
    },
    data: {
        pageNum:1,
        pageSize:20,
        iconUrl: ["wallet-consumption.png", "wallet-income.png", "wallet-timeout.png"],
        saveCardDetailList:[]
    },
    methods: {
        getCardList() {
            let params ={}
            if(this.properties.memberId != "" && this.properties.memberId != null){
                params.memberId = this.properties.memberId
            }
            params.type = 1
            console.log(params,'type=1的参数')
            orderSummaryList(params).then(res => {
                    this.data.saveCardDetailList =  res.data.data
                    console.log(res.data.data,'团队业绩-返回的结果')
                    this.setData({
                            saveCardDetailList:this.data.saveCardDetailList
                    })
            })
        },
        onReachBottom() {
            this.data.pageNum++
            this.setData({
                pageNum:this.data.pageNum
            })
            this.getCardList()
        },
        onPullDownRefresh(){
            this.data.pageNum = 1
            this.setData({
                pageNum:this.data.pageNum
            })
            this.getCardList()
        }
    }
})
